ShowPasteAsDialog
TheShowPasteAsDialog
method displays the Paste As dialog box and sets the appropriate dialog items according to the input parameters.
ODBoolean ShowPasteAsDialog ( in ODBoolean canPasteLink, in ODPasteAsMergeSetting mergeSetting, in ODFacet facet, in ODTypeToken viewType, out ODPasteAsResult theResult);
canPasteLink
- kODTrue if the destination part allows a link to be created, otherwise
kODFalse
.mergeSetting
- A value indicating whether embedding and merging are supported; determines the initial setting for the At the Destination radio buttons.
facet
- A reference to the facet from which the Paste As dialog box is triggered.
viewType
- A tokenized string representing the initial setting for the view type of the embedded part (if embedding is chosen).
theResult
- A structure reflecting the user's selections in the Paste As dialog box.
- return value
kODTrue
if the user clicked OK to leave the Paste As dialog box, otherwisekODFalse
.DISCUSSION
You should call this method in your part'sHandleEvent
method to display the Paste As dialog box when the user selects Paste As from the Edit menu.If the
canPasteLink
parameter is true, and if the content storage unit contains a link specification and the draft permissions allow writing, then the Paste with Link checkbox is checked.The mergeSetting parameter specifies which At the Destination radio button (Merge with Contents or Embed As) is initially selected in the Paste As dialog box and whether the other button is available. It must be one of the following:
The
- Embed As is initially selected; Merge with Contents is available (
kODPasteAsEmbed
).- Embed As is selected; Merge with Contents is disabled (
kODPasteAsEmbedOnly
).- Merge with Contents is initially selected; Embed As is available (
kODPasteAsMerge
).- Merge with Contents is selected; Embed As is disabled (
kODPasteAsMergeOnly
).
viewType
parameter must be the tokenized form of one of the view-type constants (kODViewAsFrame
,kODViewAsLargeIcon
,kODViewAsSmallIcon
, orkODViewAsThumbnail
). You can call the session object'sTokenize
method to obtain a token corresponding to one of these constants.If the user clicks OK, this method returns true and sets the fields of the output parameter,
theResult
, to indicate the selections the user made in the Paste As dialog box. You must dispose of the non-nullselectedKind
,translateKind
, andeditor
fields of thetheResult
structure when you are finished using them.If the user cancels the dialog box, this method returns false and you do not need to take any further action.
EXCEPTIONS
kODErrNullFacetInput
- The
facet
parameter is null.kODErrNullPasteAsResultInput
- The
theResult
parameter is null.kODErrOutOfMemory
- There is not enough memory to complete the operation.
SEE ALSO
TheODPasteAsResult
type (page 918).
TheODTypeToken
type (page 877).
TheODSession::Tokenize
method (page 622).
"Paste As" on page 250 in OpenDoc Programmer's Guide.
"Handling the Paste As Dialog Box" on page 337 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help